package cn.dgut.training.controller;


import cn.dgut.training.entity.goods.Goods;
import cn.dgut.training.entity.goods.GoodsProduct;
import cn.dgut.training.service.impl.GoodsProductServiceImpl;
import cn.dgut.training.vo.CommonResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/goods-product")
public class GoodsProductController {

    @Autowired
    private GoodsProductServiceImpl goodsProductService;

    @GetMapping("/findmessage")
    public CommonResponse findGoodsProductById(@RequestParam("id") long id){
        return CommonResponse.success(goodsProductService.getOne(new QueryWrapper<GoodsProduct>().lambda().eq(GoodsProduct::getId,id)));
    }

}
